The present embodiments relate to timer placement. More specifically, the embodiments relate to placement of application timers in a computer system.
Computer operating systems typically provide a mechanism which allows software to schedule an event to occur at some future time. This mechanism is referred to as a timer, which functions to interrupt a processor at one or more defined points in timer. A periodic interrupt is known as a system clock tick. In one embodiment, the operating system measures time in clock ticks that originates with system boot. The interrupt is a signal that prompts the operating system to stop work on one process and start work on another process.
In addition to the periodic interrupt, timers may be configured for non-periodic events. Applications often require the use of such non-periodic timers to track events such as database queries, application request, etc. These timers can be standard, e.g. low, or high resolution depending on real-time requirements of an associated application. The resolution, accuracy, or permissible error in the duration of the timer may vary with the task being performed. Often a higher degree of timer accuracy is desired. An example that requires a high resolution timer is computer animation sequencing. The animation may be playing at various frames per second, but in order to provide a viewer perception of a smooth flowing motion, the animation may require to play at least 60 frames per second. With too low of a resolution, the viewer can detect an undesirable, irregular, jerky motion in the computer animation sequence. Accordingly, different levels of precision in timer duration may be necessary depending on the underlying instruction(s).